package com.lmaos.basetools.base.prob;


public class SProb {
	private int prob;
	private Object value;
	@Override
	public boolean equals(Object obj) {
		return obj.equals(value);
	}
	@Override
	public int hashCode() {
		return value.hashCode();
	}
	public static SProb[] createSProbs(SProb... probs){
		return probs;
	}
	public SProb(int prob, Object value) {
		this.prob = prob;
		this.value = value;
	}
	public SProb(String prob, Object value) {
		this.prob = SProbUtils.toProb(prob);
		this.value = value;
	}
	private int max = -1;
	private int min = -1;
	public int getProb() {
		return prob;
	}
	public Object getValue() {
		return value;
	}
	public <T>T getObject() {
		if(value == null){
			return null;
		}
		return (T) value;
	}
	public int getMax() {
		return max;
	}
	void setMax(int max) {
		this.max = max;
	}
	public int getMin() {
		return min;
	}
	void setMin(int min) {
		this.min = min;
	}
	@Override
	public String toString() {
		return String.valueOf(value);
	}
	
	public static void main(String[] args) {
		System.out.println(new SProb(1, 1).equals(new SProb(2, 2)));
	}
}
